# name : pandas swap_rows
# key : swap_rows@pandas
# contributor: Shuguang Sun
# --
def swap_rows(df, i1, i2):
    a, b = df.iloc[i1, :].copy(), df.iloc[i2, :].copy()
    df.iloc[i1, :], df.iloc[i2, :] = b, a
    return df
